﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using SevenInvaders.common;

namespace SevenInvaders.LEVEL_JOAO
{
    class Level_Joao
    {
        JoaoPlayer joaoPlayer;
        JoaoEnemy joaoEnemy;

        public Level_Joao(ContentManager Content, GameWindow Window)
        {
            joaoPlayer = new JoaoPlayer(Content.Load<Texture2D>("LEVEL_JOAO/Nave"), new Vector2(368, 532), 1, Window,Content.Load<Texture2D>("LEVEL_JOAO/Tiro"), Content);
            joaoEnemy = new JoaoEnemy(Content.Load<Texture2D>("LEVEL_JOAO/Nave2"));
        }

        public void Update(GameTime gameTime, KeyboardState teclado, KeyboardState teclado_anterior)
        {
            joaoPlayer.Update(gameTime, teclado, teclado_anterior);
            joaoEnemy.Update(gameTime);

            for (int i = 0; i < Shoot.list.Count; i++)
            {
                Shoot.list[i].Update(gameTime);
            }

        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            joaoPlayer.Draw(gameTime, spriteBatch);
            joaoEnemy.Draw(gameTime, spriteBatch);
            
            //mandar desenhar os tiros
            for (int i = 0; i < Shoot.list.Count; i++)
            {
                Shoot.list[i].Draw(gameTime, spriteBatch);
            }

        }
    }
}
